<?php
/**
*云猫
*验证码生成文件
*QQ3522934828
*/
session_start();
$characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';$captcha = substr(str_shuffle($characters), 0, 4);
$_SESSION['captcha'] =$captcha;
$image = imagecreatetruecolor(100, 30);$background_color = imagecolorallocate($image, 255, 255, 255);$text_color = imagecolorallocate($image, 0, 0, 0);
imagefill($image, 0, 0,$background_color);
imagettftext($image, 20, 0, 15, 25,$text_color, '1.ttf', $captcha);
header("Content-type: image/png");
imagepng($image);
imagedestroy($image);
?>